package net.steam.easyjoboa.web.action;

import java.util.List;

import net.steam.easyjoboa.biz.LoginLogBiz;
import net.steam.easyjoboa.entity.LoginLog;
import net.steam.easyjoboa.entity.PageBean;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;

public class LoginLogAction {

	private LoginLogBiz loginLogBiz;
	private PageBean pb;
	private List<LoginLog> logs;
	private String star_time;
	private String end_time;
	/**
	 * 查询登录日志，跳到查询页面
	 * @return
	 */
	@Action(value="getAllByDate",results={
			@Result(name="input",location="/log_list.jsp"),
			@Result(name="success",location="/log_list.jsp")})
	public String getAll(){
		if(pb==null){
			pb=new PageBean();
		}
		logs=loginLogBiz.findAllLog(pb, star_time, end_time);
		if(logs.size()==0){
			return "input";
		}else{
		return "success";
		}
	}
	
	/**
	 * 按时间查询登录日志，并跳到导出页面
	 * @return
	 */
	@Action(value="exportByDate",results={@Result(name="input",location="/export_log.jsp"),@Result(name="success",location="/export_log.jsp")})
	public String exportLog(){
		return null;
	}
	
public PageBean getPb() {
	return pb;
}
public void setPb(PageBean pb) {
	this.pb = pb;
}
public void setLoginLogBiz(LoginLogBiz loginLogBiz) {
	this.loginLogBiz = loginLogBiz;
}

public String getStar_time() {
	return star_time;
}
public void setStar_time(String star_time) {
	this.star_time = star_time;
}
public String getEnd_time() {
	return end_time;
}
public void setEnd_time(String end_time) {
	this.end_time = end_time;
}
public List<LoginLog> getLogs() {
	return logs;
}
public void setLogs(List<LoginLog> logs) {
	this.logs = logs;
}
	
	
}
